package com.中介者模式;

/**
 * 同事类：闹钟
 */
public class NaoZhong extends Coleague{
    /**
     * 有参构造
     */
    public NaoZhong(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name,this);
    }

    /**
     * 实现发送消息的方法
     */
    @Override
    public void sendMessage(int stateChange) {
        getMediator().getMessage(stateChange,this.name);
    }
}
